﻿using System.Collections.ObjectModel;
using System.Windows.Controls;

using Game.Objects;
using Game.Toolkit;
using Game.Types;

namespace Game.Editor.Toolbox
{
    public class InfrastructureControl2 : UserControl
    {
        readonly WrapPanel _Panel = new WrapPanel();

        public InfrastructureControl2()
        {
            InitializeComponent();
            Init();
        }

        void InitializeComponent()
        {
            Grid grid = new Grid();
            this.Content = grid;
            ScrollViewer viewer = new ScrollViewer();
            grid.Children.Add(viewer);

            WrapPanel panel = new WrapPanel();
            viewer.Content = _Panel;
        }

        void Init()
        {
            Collection<ObjectType> col = StandardInfrastructure.Railroad;
            foreach (ObjectType v in col)
            {
                InfrastructureItemControl2 control =
                    new InfrastructureItemControl2();
                control.ObjectType = v;
                control.Width = 50;
                control.Height = 50;
                _Panel.Children.Add(control);
            }
        }

    }
}
